import requests
from lxml import etree
from redisDemo import getInstanct
from demo2 import xsToFile

rd = getInstanct()

URL = "https://www.kuaiyankanshu.net/5734/"
response = requests.get(URL)
response.encoding = "utf-8"
root = etree.HTML(response.content)

res = root.xpath("//li[@class='hide']/a/@href")

with open("test.txt","w",encoding="utf-8") as f:

    for i,ele in enumerate(res):
        print(i,ele)
        f.write(ele+"\n")
        rd.lpush("xsList", ele)
        
    




